package com.data.unityplugin_market.business.center

import android.app.Instrumentation
import android.databinding.DataBindingUtil
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.data.unityplugin_market.base.BaseDataBindingAdapter
import com.data.unityplugin_market.base.BaseFragment
import com.data.unityplugin_market.viewmodel.MyOrderFragmentVM
import com.data.unityplugin_market.viewmodel.OrderItemVM
import com.data.unityplugin_market_lib.BR
import com.data.unityplugin_market_lib.R
import com.data.unityplugin_market_lib.databinding.FragmentModifyAddressBinding
import com.data.unityplugin_market_lib.databinding.FragmentMyOrderBinding

public class  MyOrderFragment : BaseFragment(){

    var view = null;

    var binding : FragmentMyOrderBinding? = null
    var orderItemList = ArrayList<OrderItemVM>()
    var adapter : BaseDataBindingAdapter<OrderItemVM>? = null

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {



        binding  = DataBindingUtil.inflate(inflater,R.layout.fragment_my_order , null , false)
        binding!!.myOrderVM = MyOrderFragmentVM()

        for(i in 0..10 )kotlin.run {
            var item = OrderItemVM()
            item.totalPrice.set("1232321321321")

            orderItemList.add(item)
        }


        adapter = BaseDataBindingAdapter(context!!, layoutInflater, R.layout.widget_myorder_list_item, BR.orderItemVM, orderItemList)
        binding!!.recycleviewOrderList.layoutManager = LinearLayoutManager(context)
        binding!!.recycleviewOrderList.adapter = adapter


        return binding!!.root

    }

    fun allClick(){

    }

    fun pendingPay(){

    }

    fun pendingShip(){

    }

    fun pendingReceive(){

    }
}